package leading;

import java.util.Random;
import java.util.Scanner;

public class GuessNumber {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = 0;
		boolean flag = false;
		int count = 0;
		 int rd =  (int)(Math.random()*100)+1;
		while(!flag){
			System.out.println("请输入您猜的数字：");
			num = sc.nextInt();
			if(num == rd){
				flag = true;
			}else if(num>rd){
				System.out.println("您输入的值大了！");
				flag = false;
				count ++;
			}else if(num<rd){
				System.out.println("您输入的值小了了！");
				flag = false;
				count ++;
			}
			if(count == 10){
				System.out.println("你真笨！！！");
				return ;
			}
		}
		System.out.println("挺聪明啊小伙！！！");
	}
}
